package org.jeecg.modules.relation.relclassstudent.entity;

import java.io.Serializable;
import java.util.Date;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecg.config.mybatis.TenantContext;
import org.jeecg.modules.common.baseentity.PublicBeanPage;
import org.jeecg.modules.common.utils.DateUtil;
import org.jeecg.modules.student.vo.StuStudentVo;
import org.jetbrains.annotations.NotNull;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * @Description: rel_class_student
 * @author: baochangrong
 * @Date:   2022-02-10
 * @Version: V1.0
 */
@Data
@TableName("rel_class_student")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="rel_class_student对象", description="rel_class_student")
public class RelClassStudent implements Serializable  {
    private static final long serialVersionUID = 1L;

	/**id*/
	@TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "id")
    private String id;
	/**班级code*/
	@Excel(name = "班级code", width = 15)
    @ApiModelProperty(value = "班级code")
	@Dict(dictTable = "cou_class",dicCode = "id",dicText = "grade_code")
	private String classId;
	/**学生code*/
	@Excel(name = "学生code", width = 15)
    @ApiModelProperty(value = "学生code")
	@Dict(dictTable = "stu_student",dicCode = "id",dicText = "student_name")
    private String studentId;
	/**有效状态*/
	@Excel(name = "有效状态", width = 15)
    @ApiModelProperty(value = "有效状态")
    private Integer classStudentStatus;
	/**createTime*/
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @ApiModelProperty(value = "createTime")
    private Date createTime= DateUtil.getCurrentDate();

	/**createTime*/
	@Excel(name = "学校ID", width = 15)
    @ApiModelProperty(value = "学校ID")
    private String tenantId= TenantContext.getTenant();

	// 学年
	@Excel(name = "学年ID", width = 15)
	@ApiModelProperty(value = "学年ID")
	@Dict(dictTable = "cou_school_year",dicText = "school_year_name",dicCode = "id")
	private String schoolYearId;
	// 学期
	@Excel(name = "学期ID", width = 15)
	@ApiModelProperty(value = "学期ID")
	@Dict(dictTable = "cou_semester",dicText = "semester_name",dicCode = "id")
	private String semesterId;
	//班级名称
	@Excel(name = "班级名称", width = 15)
	@ApiModelProperty(value = "班级名称")
	private String className;
	public RelClassStudent(){

	}

	public RelClassStudent(@NotNull StuStudentVo stuStudentVo){
	    this.classId = stuStudentVo.getClassId();
	    this.studentId = stuStudentVo.getId();
	    this.classStudentStatus = 1;
	    this.tenantId = stuStudentVo.getTenantId();
	    this.schoolYearId=stuStudentVo.getSchoolYearId();
		this.semesterId=stuStudentVo.getSemesterId();

    }
}
